<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">

        <div><?php include "../public_flow/flow_show_info.php";?></div>

        <div class="table-box tablenes">
            <div class="title">基本信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">收支类型</td><td id="type_name" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">关联单据</td><td id="sericnum" class="colorlan tv"></td><td class="tt">交易类型</td><td id="modtype_name" class="tv"></td></tr>
                <tr><td class="tt">交易单号</td><td id="jiaonum" class="tv"></td><td class="tt">交易金额(元)</td><td id="money" class="tv"></td></tr>
                <tr><td class="tt">款项类型</td><td id="feilei_name" class="tv"></td><td class="tt">款项摘要</td><td id="zhai" class="tv"></td></tr>
                <tr><td class="tt">交易对象</td><td id="duier" class="tv"></td><td class="tt">交易方式</td><td id="incdaotype" class="tv"></td></tr>
                <tr class="zhi_info layui-hide"><td class="tt">账号</td><td id="banknum" class="tv"></td><td class="tt">开户行</td><td id="bankname" class="tv"></td></tr>
                <tr><td class="tt">交易日期</td><td id="dt" class="tv"></td><td class="tt">资金账户</td><td id="accid_name" class="colorlan tv"></td></tr>
                <tr><td class="tt">经办人</td><td id="baner" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">备注</td><td id="explain" class="tv" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>


        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_account_list_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var kuan = res.data.kuan;
                var bill = res.data.bill;
                var account = res.data.account;

                if(account){
                    $("#accid_name").text(account.name+'('+account.accnum+')').click(function () {
                        openPage('../account/show.php?id='+account.id);
                    });
                }

                if(bill){
                    $("#sericnum").text(bill.sericnum).click(function () {
                        openPage('../'+bill.modenum+'/show.php?id='+bill.mid);
                    });
                }



                $("#type_name").text(data.type_name);
                $("#jiaonum").text(data.jiaonum);
                $("#modtype_name").text(data.modtype_name);
                if(kuan){
                    $("#feilei_name").text(kuan.feilei_name);
                    $("#zhai").text(kuan.zhai);
                    $("#money").text(data.money);
                    $("#duier").text(kuan.duier);
                    $("#incdaotype").text(kuan.incdaotype);
                    $("#banknum").text(kuan.banknum);
                    $("#bankname").text(kuan.bankname);
                }

                $("#dt").text(data.dt);
                $("#baner").text(data.baner);
                $("#explain").text(data.explain);


                if(data.type_name == '支出'){
                    $(".zhi_info").removeClass('layui-hide');
                }


                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('account_list', param_id);
        showpage_dropopt();
    });



</script>
</body>
</html>




